home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-27 | 12.8 KB | 387 lines | [TEXT/McSk] |
- /* XFoxEvents version 1.4.2, 8-AUG-1993 ©1993 A.D. Software
-
- THIS IS NOT FREE - see Shareware Details at end.
-
- OVERVIEW
- XFoxEvents was previously known as XBrowse2Click and was renamed in the v1.3
- release to better indicate the product purpose. It provides event filters for
- solving problems with the user-interface of FoxBase+/Mac:
- 1) the Browse filter allows you to convert double-clicking or hitting
- the Tab, Enter or Return keys into a command-keystroke of your
- choice (eg: command-O for Open), or a keystroke (ctrl-W= chr(23) ) which
- will terminate a FOX READ. This enables you to double-click Browse lines
- and go straight into editing a record.
-
- 2) the Return filter simply converts Return characters to Tabs. This is
- useful if you want to have the TAB and RETURN keys jump between fields
- yet still have Enter terminate the READ and have looping back to the
- top field (ie: using SET STRICT ON). The problem with FoxBase is that
- the Return key is usually treated the same as Enter.
-
- 3) the MouseDown filter allows you to convert a SINGLE mouse-click into a
- command-keystroke or ctrl-W. It has up to 255 optional filter rectangles
- which restricts it to sensing in a given area.
- Version 1.4.1 adds an Invert option to MouseDown which allows you to
- REPLACE FOX BUTTONS! You can then use the UPDATED() function to see if
- any GET's have modified data.
-
- The default is to trap clicks anywhere on the screen, OVERRIDING ANY
- FOX BUTTONS OR FIELDS. You would only use the default case for
- something like an overall picture with no other fields or controls.
- (eg: showing a map).
-
-
- DETAILS OF USING THE XFCN
-
- THEORY
- The XFCN actually installs a separate piece of code for each of the filters,
- very much like the "inits" such as PopChar, screensavers etc. Therefore it is
- VERY important to Deactivate the current filter when you are finished.
-
- The filters are aware when you "change application layers" under MultiFinder
- or System 7.
-
- WARNING - if you RELEASE the XFCN you will waste a chunk of FoxBase memory. Don't
- release the XFCN and then LOAD it - leave it loaded for the life of your program.
-
-
- GENERAL USE OF XFCN'S
- XFCN's (and XCMDs) live in the current RESOURCE file, either your default
- FOXUSER file or a file that you've specified with a SET RESOURCE TO. They are
- loaded with the LOAD command (eg: LOAD XFoxEvents FUNCTION). Note that the
- FUNCTION keyword is used as shown in this example for any XFCN's (to load an
- XCMD you just specify LOAD anXCMD).
-
- The difference between XFCN and XCMD is that the XFCN returns a value, much
- like a FoxBase UDF.
-
- To call an XFCN you issue a CALL command which returns a value to the
- specified variable (creating it if doesn't already exist).
- eg: CALL XFoxEvents TO res WITH "L"
-
- Normally, you can reuse the memory of an XFCN with the RELEASE MODULE itsName
- command. However, this should NOT be applied to this XFCN - load it once,
- early, and leave it loaded (you don't have to release it if you are quitting
- your program as the quitting action cleans up the memory).
-
- WARNING
- 1) It will cause all kind of weird errors if you LOAD the same XFCN twice
- while running, without doing a RELEASE MODULE of the earlier LOAD.
-
- 2) It is VERY important not to RELEASE MODULE this XFCN while a filter is
- active, as another load of the XFCN wouldn't know about the active filter.
-
-
- DETAILS OF USING XFoxEvents
- In general, the return value is used to indicate success or the nature of an
- error. The first parameter is a "switch" to tell the XFCN which operation to
- perform.
-
- The following descriptions show a sample usage of each call, with full details
- of any additional parameters and the return value(s).
-
-
- LOADING THE FILTERS
- This step is performed ONCE for each run of your program or FoxBase (ie: don't
- repeat without exiting FoxBase).
-
- CALL XFoxEvents TO res WITH "L"
-
- RETURN VALUES
- 0 = OK
- -1 = invalid function switch
- -2 = couldn't find one of the filters
-
-
- ACTIVATING THE BROWSE FILTER
-
- PARAMETERS
- 1 - "B"
- 2 - letter of the command key to send OR
- "" means send ctrl-W OR
- chr(27) will send ESC
-
- 3 - bitmask of what events are converted to a command-key
- bit value
- 0 = double-click (1)
- 1 = Enter key (2)
- 2 = Return key (4)
- 3 = Tab key (8)
- eg: value of 15 = react to all four events
- value of 3 = react to double-click and Enter but NOT Tab or Return
-
- CALL XFoxEvents TO res WITH "B", "O", 3
-
- RETURN VALUES
- 0 = OK
- -1 = invalid function switch
-
- NOTE: with the standard Browse windows, there is a title area at the top of the window.
- Double-clicks in this area will still be detected - effectively giving you the "feature"
- of double-click the titles to open the currently selected record, regardless of it
- being out of sight. Nobody's complained about this so far so I left it in.
-
-
-
- ACTIVATING THE RETURN FILTER
- Every Return keystroke will be converted to a Tab, until you perform a
- Deactivate. Note: this only applies to the plain Return key, pressed
- without any modifiers (eg: option-Return, shift-Return). You can therefore use
- option-Return within memo fields, the same as you can use option-Tab.
-
- PARAMETERS
- 1 - "R"
-
- eg: CALL XFoxEvents TO res WITH "R"
-
- RETURN VALUES
- 0 = OK
- -1 = invalid function switch
-
-
-
- MOUSEDOWN SUMMARY
- The mousedown filter allows you to clear the status flag without
- repeating the activate call. You can define one hot rectangle at the
- time of activation and follow that call with a number of additional
- definition calls to a total of 255 hot rectangles. If you have a hot
- rectangle list established, the Activate allows you to retain that list
- without redefinition. This will be retained until you exit FoxBase.
-
- The filter returns the logical number of the rectangle clicked, to save
- you working that out from the position clicked.
-
- With the MI call, you can set the filter mode where
- the clicked rectangle is highlighted like a button, including the logic
- to "slide-off" without releasing the mouse.
-
- In the Button Bar mode (MB) clicks in the frontmost window will be
- ignored and only clicks in a background window will be processed.
- (See the comprehensive example for how this is used in practice).
- NOTE all background Fox windows are considered to be button bars and will
- accept clicks, regardless of their actual content.
-
-
- ACTIVATING THE MOUSEDOWN FILTER
-
- PARAMETERS
- 1 - "M" optional 2nd letter E means use Existing rectangles
- 2 - letter of the command key to send OR
- "" means send ctrl-W OR
- chr(27) will send ESC
- following are optional, defaults to whole window, or existing list
- 3 - top
- 4 - left
- 5 - bottom
- 6 - right
-
- eg: for a single line, given a clause in a .FMT like
- @ PIXELS 125,7 SAY "Community Serv:" STYLE 65536 FONT "Chicago",12
- you can work out the width and height with
- screen 1 font "Chicago",12 top
- ?val(sys(1025)) + val(sys(1026)) + val(sys(1027))/3 && height
- && as used by Fox in row,col addressing ascent + descent + leading/3
- ?sys(1030, "Community Serv:") && width
-
- OR
-
- just use the current point size for the height
-
- CALL XFoxEvents TO res WITH "M", "", 3, 125, 15, 185
-
- RETURN VALUES
- 0 = OK
- -1 = invalid function switch
- -4 = not enough parameters (either 2 or all 6 are needed)
-
-
- ADDING MORE MOUSEDOWN FILTER HOT RECTANGLES
-
- PARAMETERS
- 1 - "MR"
- 2 - top
- 3 - left
- 4 - bottom
- 5 - right
-
- CALL XFoxEvents TO res WITH "MR", 3, 125, 7, 12, 60
-
- RETURN VALUES
- 0 = OK
- -1 = invalid function switch
- -4 = not enough parameters
-
-
- CLEARING THE MOUSEDOWN STATUS FLAG
- PARAMETERS
- 1 - "MC"
-
-
- ENABLING INVERTING OF RECTANGLES
- PARAMETERS
- 1 - "MI"
- 2 - "+" to enable mode, any other char to disable, default is ON
-
-
- ENABLING BUTTON BAR MODE
- PARAMETERS
- 1 - "MB"
- 2 - "+" to enable mode, any other char to disable, default is ON
-
-
- GETTING THE MOUSEDOWN POSITION
- PARAMETERS
- 1 - "MG"
- optional
- 2 - name of vertical position variable to return
- 3 - name of horizontal position variable to return
-
- Note: the position is set by the Mousedown filter and a flag is set
- to know if the event has been trapped which is cleared implicitly
- when this call is made.
-
- CALL XFoxEvents TO res WITH "G", "mouseV", "mouseH"
-
- RETURN VALUES
- 0 = NOT a mouse-down event since the last activate/clear
- 1 or higher = WAS a valid mouse-down, number returned represents
- which of the rectangles was clicked
- -1 = invalid function switch
- -4 = not enough parameters
-
-
-
- WARNING WARNING WARNING WARNING WARNING WARNING WARNING
-
- DEACTIVATING FILTERS
- MUST be carried out before quitting FoxBase. Failure to do so will cause your Mac
- to crash. Note: the filters do NOT have to be deactivated before switching context
- to another program, under MultiFinder or System 7, provided FoxBase is still running.
-
- CALL XFoxEvents TO res WITH "D"
-
- RETURN VALUES
- 0 = OK
- -1 = invalid function switch
-
- WARNING WARNING WARNING WARNING WARNING WARNING WARNING
-
-
-
- ***************************************************************************
- V E R S I O N H I S T O R Y
- 1.0 14-SEP-1992
- initial public release as XBrowse2Click
-
- 1.3 1-FEB-1993
- public release with mouseDown filter
- renamed to XFoxEvents
-
- documentation extended to clarify some points
-
- compiled with Think C 5.0.4 & Think Pascal 4.0.2.
-
- Browse2Click filter restricted to content area of window (a double click
- anywhere would cause exit in original!) and now can generate ctrl-W or
- ESC keystrokes, instead of just command-keys.
-
- MouseDown filter added.
-
- 1.4 7-MAY-1993
- Released to celebrate my 30th birthday!
-
- Content area checking for Browse2Click and MouseDown filters bugs fixed
- and conflict with Now Menus resolved.
-
- See extra notes on Browse2Click function.
-
- 1.4.1 3-AUG-1993 (not an official release)
- Mousedown enhancements:
- - return value is now 1 or higher, giving you the number of the rectangle
- to save having to work it out from the position clicked
- - MI call added to enable (or then disable) "Invert" mode which inverts
- the rectangles as if they were buttons.
-
- 1.4.2 8-AUG-1993
- Mousedown enhancements:
- - "MI" call given secon param, rather than acting as a toggle on/off
- - "MB" call added to give Button Bar effect
- - clicks in other windows ignored (except when in Button Bar mode)
- - Rectangle documentation error corrected (I use top,left,bot,right)
-
- General Enhancements:
- - now able to use more than one filter together, so double-click and Mousedown
- (Button Bar) can be used on Browse
- - comprehensive demo written
-
- 1.4.3 28-AUG-1993
- Mousedown bugfix:
- - the MI call suppressed clicks elsewhere in the window.
-
- Recompiled all filters with Think C v6.0.1
-
-
- FUTURE PLANS (depending on demand and YOUR feedback)
- Combine the Browse2Click and MouseDown functions into one, so single or double
- clicks can be detected, and drag-n-drop can be performed from specified areas to
- others.
- ***************************************************************************
-
-
-
- SHAREWARE DETAILS
- Godfather Holdings Pty Ltd as trustee for
- The Dent Family Trust
- Trading as A.D. Software
- Australian Company Number 009 453 007
-
- Contact: Andy Dent BSc, MACS
- 94 Bermuda Drive, Ballajura Western Australia 6066
- Phone/Fax: (09) 249 2719
- International: 61 9 249 2719
- CompuServe: 100033, 3241
- Internet: dent@dialix.oz.au
-
- PAYMENT VIA (decreasing preference)
- CompuServe SWREG (check the library summary for the SWREG number)
- Australian dollars cash
- Australian bank or personal cheques (made out to A.D. Software)
- International Money Orders
- Visa, Mastercard or Australian Bankcard
-
- FEE & UPDATE DETAILS
- The fee is $50 Australian (due to our rotten exchange rate
- this is about $36 US).
- Registered users will receive free upgrades with notices mailed
- (electronically where possible) of new versions being uploaded,
- and available on disk for a nominal shipping fee, on request.
-
-
- OTHER FOXBASE XCMDS
- XScrollList Provides loading, filing & display of "arrays" in normal
- Mac dialogs with usual list handling facilities supporting arrow keys,
- type first few letters to jump to an entry etc.
-
- Arrays stored outside of Fox 64kb memory limit and loaded many times
- faster than is possible with arrays inside Fox.
- Dialog returns list entry number, record number (optional) and text
- of entry selected.
-
- Dialogs are constructed as resources (using Apple's ResEdit) and can have as
- many buttons as you like, the name of the button pressed being returned to a
- Fox variable.
-
- Multiple selections are also supported, using the standard technique of
- shift-click to select a contiguous range or command-click for ad-hoc items.
-
-
- XGetDepth - returns the pixel depth (ie 2, 4, 8, 16 or 32) of the screen (freebie)
-
-
- OTHER PRODUCTS & SERVICES
- A.D. Software is a custom software development house — if you have any other
- XCMD or other programming requirements, please contact me for further information.
-
- Major products include a FORTRAN->Pascal translator and multi-user classified
- advertisement publishing system.
- ---------------------------------------------------------------------------------*/